/*******************************************************************************
 * Copyright (c) Bartosz Michalik and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Bartosz Michalik (bartosz.michalik@gmail.com)
 *******************************************************************************/
package org.eclipse.pde.internal.core.iproduct;

import java.util.Map;
import org.eclipse.pde.core.plugin.IPluginObject;
import org.eclipse.pde.internal.core.product.RemoveTransform;

/**
 * ITransformation manager manages all transformations for given product.
 * 
 * @author Bartosz Michalik
 * 
 */
public interface ITransformationsManager extends IProductObject {

	/**
	 * Add transformation to the transformations' set. If transformation is
	 * {@link RemoveTransform} transformation laying down the tree are removed.
	 * 
	 * @param transform
	 * @return true if transformation successfully added
	 */
	public boolean add(IProductTransform transform);

	/**
	 * Remove given transformation
	 * 
	 * @param transform
	 * @return true if succeed
	 */
	public boolean remove(IProductTransform transform);

	/**
	 * Remove transformation for give object
	 * 
	 * @param object
	 * @return true if succeed
	 */
	public boolean remove(IPluginObject object);

	/**
	 * Remove all transforms for give bundle
	 * 
	 * @param pluginId
	 * @return transforms that have been removed
	 */
	public IProductTransform[] removeAll(String pluginId);

	/**
	 * Check if object is affected by the transformation. Note that for now only
	 * {@link RemoveTransform} affects objects.
	 * 
	 * @param object to check
	 * @return true if object is affected
	 */
	public boolean isAffected(IPluginObject object);

	/**
	 * Check if there is at least one transformation for the object
	 * 
	 * @param object to check
	 * @return true if transformation is present
	 */
	public boolean isTransformed(IPluginObject object);

	/**
	 * Check if given object has any transform deeper the tree
	 * @param object - object for which we want to check 
	 * @return true if deeper the tree is a transform attached
	 */
	public boolean hasTransforms(IPluginObject object);

	/**
	 * Get all transforms for specific plug-in
	 * 
	 * @param pluginId
	 * @return all transformation for plug-in pluginId or empty array
	 */
	public IProductTransform[] getAll(String pluginId);

	// TODO remove when not used any more
	public Map getTransforms();

}